<template>
  <div class="dashboard-container">
    <el-row :gutter="20">
      <!-- 数据概览卡片 -->
      <el-col :span="6">
        <el-card shadow="hover">
          <template #header>
            <div class="card-header">
              <span>总会员数</span>
            </div>
          </template>
          <div class="card-body">
            <div class="number">2,345</div>
            <div class="compare">
              较上月 <span class="up">+12.5%</span>
            </div>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="6">
        <el-card shadow="hover">
          <template #header>
            <div class="card-header">
              <span>本月新增会员</span>
            </div>
          </template>
          <div class="card-body">
            <div class="number">128</div>
            <div class="compare">
              较上月 <span class="up">+8.3%</span>
            </div>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="6">
        <el-card shadow="hover">
          <template #header>
            <div class="card-header">
              <span>黑卡持有数</span>
            </div>
          </template>
          <div class="card-body">
            <div class="number">1,890</div>
            <div class="compare">
              较上月 <span class="up">+5.2%</span>
            </div>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="6">
        <el-card shadow="hover">
          <template #header>
            <div class="card-header">
              <span>本月交易额</span>
            </div>
          </template>
          <div class="card-body">
            <div class="number">¥3.45M</div>
            <div class="compare">
              较上月 <span class="up">+15.8%</span>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>

    <!-- 图表区域 -->
    <el-row :gutter="20" class="chart-row">
      <el-col :span="12">
        <el-card shadow="hover">
          <template #header>
            <div class="card-header">
              <span>会员增长趋势</span>
            </div>
          </template>
          <div class="chart-container">
            <!-- 这里可以添加echarts图表组件 -->
            <div class="chart-placeholder">会员增长趋势图表</div>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="12">
        <el-card shadow="hover">
          <template #header>
            <div class="card-header">
              <span>交易额统计</span>
            </div>
          </template>
          <div class="chart-container">
            <!-- 这里可以添加echarts图表组件 -->
            <div class="chart-placeholder">交易额统计图表</div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script setup>
// 这里可以添加数据获取和处理逻辑
</script>

<style scoped>
.dashboard-container {
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  text-align: center;
  padding: 20px 0;
}

.number {
  font-size: 24px;
  font-weight: bold;
  color: #303133;
  margin-bottom: 10px;
}

.compare {
  font-size: 14px;
  color: #909399;
}

.up {
  color: #67C23A;
}

.down {
  color: #F56C6C;
}

.chart-row {
  margin-top: 20px;
}

.chart-container {
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chart-placeholder {
  color: #909399;
  font-size: 14px;
}
</style> 